UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bnsyIC3auPUhbEixXELoqyfcOBYEooH8EZ5hNGZu4qc='
WHERE
key_id = '3bd0cd83725011ff1fecb0edaeb8f0354797f88f00f30056f5c23964b9eeffc8'
AND (
token = 'bnsyIC3auPUhbEixXELoqyfcOBYEooH8EZ5hNGZu4qc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)