UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5PL/Z3Q9keQ1qnZE4wC7ypeg/As3o/30XhY5FZ1bYCc=' 
WHERE 
  key_id = '473e99f63034985c7234125f89735ec7702e90a6f200311730dbabd0ee9d4fbd' 
  AND (
    token = '5PL/Z3Q9keQ1qnZE4wC7ypeg/As3o/30XhY5FZ1bYCc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027