UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lT7xAjBbpmbW4vuRUOzFxo2/CPAjjcTgjhXRTnyU8E0='
WHERE
key_id = '425327e1c4cc94a85d9d2df0f2b51a3a290d6383508b6b819251098e03407b8a'
AND (
token = 'lT7xAjBbpmbW4vuRUOzFxo2/CPAjjcTgjhXRTnyU8E0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)