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