UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'suDfH+63ZJ4/7PszEgLGzZpxr/d61GVTBUJY648Wovw=' 
WHERE 
  key_id = '50e5008f2a3dc29410396af8bef74922cd18084c168578092aff2445572dd574' 
  AND (
    token = 'suDfH+63ZJ4/7PszEgLGzZpxr/d61GVTBUJY648Wovw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030