UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wd/VeDVifElFNGunXfpX8O95Uu87FdVOmq3X0SZwves='
WHERE
key_id = '0965ea684c1ccf368c5b34ad578163218365ee127bcae4cf1b49e6ba81d6705c'
AND (
token = 'wd/VeDVifElFNGunXfpX8O95Uu87FdVOmq3X0SZwves='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)