UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'szpucSwU1Za4uur4UcKSsM+wbHEfy8N2B+2W8gtF2HY=' 
WHERE 
  key_id = '9832bfaffd978dcd166726dceb27749726fa18a7a05b9b6bc93c16053f81e6bf' 
  AND (
    token = 'szpucSwU1Za4uur4UcKSsM+wbHEfy8N2B+2W8gtF2HY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040