UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zklFgo0FzHs6MiOqYIxsb8fokEER3lqxw6f3Buko9Pg=' 
WHERE 
  key_id = '0f99dc186203da18034dcc528a9a99fe9d32365c913cd243767b5c6f6cd3c023' 
  AND (
    token = 'zklFgo0FzHs6MiOqYIxsb8fokEER3lqxw6f3Buko9Pg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026