UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9jWxjJ4AdoJ0qsrQLRFSTwJ7nOQY/BP8/3uomvM6q68=' 
WHERE 
  key_id = '516a2b6d7ef87939474508a1596d92ed6209ae84501fcd31c65b63c33c74a081' 
  AND (
    token = '9jWxjJ4AdoJ0qsrQLRFSTwJ7nOQY/BP8/3uomvM6q68=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035