UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0t1J4NWchhD6yIobO7ZHkt+DoNKmAHVMoN6U8sUd3vk='
WHERE
key_id = '93fe456802f87ccb6b39debaba52fa44154dbc665e1045c78bfc395676327d7b'
AND (
token = '0t1J4NWchhD6yIobO7ZHkt+DoNKmAHVMoN6U8sUd3vk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)