UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xj9uQO0uOE1xYY7XEJO37GxN5gTnqJNrZjRHDlRLdgU=' 
WHERE 
  key_id = '0136f5fc95c049be170914d1759a1affdec77e8bc3b34a99438bcb51f3968c16' 
  AND (
    token = 'xj9uQO0uOE1xYY7XEJO37GxN5gTnqJNrZjRHDlRLdgU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028