UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'y1eRhR8t+Xxuh4sHH0ThVPJw4GadCwJ8Rv19ctF4H8Q='
WHERE
key_id = 'de2fb11e087c9761f5e8f543114838e73bc2f6340759ad7ff5d52dc4beb3f8f6'
AND (
token = 'y1eRhR8t+Xxuh4sHH0ThVPJw4GadCwJ8Rv19ctF4H8Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)