UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CeuCp1YOA5eVbmzwkOMUnXNfbxSwOCqPZrlDCxya2yA=' 
WHERE 
  key_id = '67213f8c62a9e69e261b65cc7ca456dd64648c98ff63b19bd36f29fa5b590e40' 
  AND (
    token = 'CeuCp1YOA5eVbmzwkOMUnXNfbxSwOCqPZrlDCxya2yA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030