UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Odf6nYwgxTugUTlnnd6q4YrYGG3bmstaeE4L9FuhC54='
WHERE
key_id = 'abc5dff7a0c6f83f514b435a97098b06c5811120d7e5ce112e43a1d3e3c449e8'
AND (
token = 'Odf6nYwgxTugUTlnnd6q4YrYGG3bmstaeE4L9FuhC54='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)