UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PvCChEQPnDs/gL0XFJ81QcxEt6ggWj1VKILP5fVE/pk='
WHERE
key_id = 'ba927f0ded7e929edffe7d1937601ac6b3572f2f035e5d143394a8083f28708e'
AND (
token = 'PvCChEQPnDs/gL0XFJ81QcxEt6ggWj1VKILP5fVE/pk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)