UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8yP9QYaaQEjjDayLc8tX59WFvPZt9OW6NZ/nBgH3h5I='
WHERE
key_id = 'b2aed28cecbe12219d85c000794cea83ec7b4f9655c050a0442179786e6913e0'
AND (
token = '8yP9QYaaQEjjDayLc8tX59WFvPZt9OW6NZ/nBgH3h5I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)