UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kbt5wx41oTmnTgj5NrTtec3bTIJDR65jpuZwaEgxzsQ=' 
WHERE 
  key_id = 'df2b9de3b6890abe9a279355be8b2268bd0b3a624a5d266f44809126e2703782' 
  AND (
    token = 'kbt5wx41oTmnTgj5NrTtec3bTIJDR65jpuZwaEgxzsQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050