UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PqNjv7+olqjylW5kOPskWwBJyK02kEms6J/407bNV0Q=' 
WHERE 
  key_id = '423f1ef1a6ed5947da715dce3fbd23ed35a276ab2d649db79bced3cfa8d953b9' 
  AND (
    token = 'PqNjv7+olqjylW5kOPskWwBJyK02kEms6J/407bNV0Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023