UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9fQNi0tyuanSFPnaxafi4YYPF4te3h6R08z1Q/PiXa0='
WHERE
key_id = 'e4bcdaeabefe4033eb895582c4c0328ef3a9a6fc139296f965f5bf689e47b3fa'
AND (
token = '9fQNi0tyuanSFPnaxafi4YYPF4te3h6R08z1Q/PiXa0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)