UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aFJkjhLQrYxBrUT7Y8xzzg/p5gQCPR9AK6WMnvs0Uv4=' 
WHERE 
  key_id = 'bc2282ff6db5177a1f19c20d2abae844e1fb71e5f2c5dd2dd82fe8380daf587d' 
  AND (
    token = 'aFJkjhLQrYxBrUT7Y8xzzg/p5gQCPR9AK6WMnvs0Uv4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024