UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TSz3qmJ3sALv2T0IQ/sT2PdJzf2USEhL/XLZ4FmOPz4=' 
WHERE 
  key_id = '2a5b11ab4cb70a51669ac048c5830975515f81b6a6b888e6cb310d8f14b7bea2' 
  AND (
    token = 'TSz3qmJ3sALv2T0IQ/sT2PdJzf2USEhL/XLZ4FmOPz4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035