UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DcciJCfa29jWNOJLpxR49hF/ICjEjAIgiyWdBsegbqw=' 
WHERE 
  key_id = 'fb847dfa860838ff1119188f9cc120db7376342623d8e708f0daed8d773475ca' 
  AND (
    token = 'DcciJCfa29jWNOJLpxR49hF/ICjEjAIgiyWdBsegbqw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00077