UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'b6M7Yc/XsfZMlDJsZQ+07geL4ccoY3DsyMSsdPsSzww=' 
WHERE 
  key_id = '0f8b09dc5c3c0ead44cf8f1fcfda9212e4f737112587403247a5dab2d2067956' 
  AND (
    token = 'b6M7Yc/XsfZMlDJsZQ+07geL4ccoY3DsyMSsdPsSzww=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045