UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vm20/nSVzPCX7v8t1J1dvSLplVmP19lklaxIjg4h6Og=' 
WHERE 
  key_id = '18ed3e97f94c1eb8aafc2cbfb7f2b79a985c9e5dcdb8115a94eed8c01c82d62c' 
  AND (
    token = 'vm20/nSVzPCX7v8t1J1dvSLplVmP19lklaxIjg4h6Og=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045