UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DpCCgv6whba7KS57pZ2vqJhRfmxHQ/mxmw5jquNvSnQ=' 
WHERE 
  key_id = 'ee8f7609edf3c6a305cd1c53a8316cb50fcfd0b5252d93462d274b38a9628af9' 
  AND (
    token = 'DpCCgv6whba7KS57pZ2vqJhRfmxHQ/mxmw5jquNvSnQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041