UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oFqMlOjMiaQuwah6H8QikhUii4VDIZVSFjD0QLp/b8g='
WHERE
key_id = '7685d4b197cd8e6336bda007c5c64208472dd69000b2fe2f9e670ae956bf1af1'
AND (
token = 'oFqMlOjMiaQuwah6H8QikhUii4VDIZVSFjD0QLp/b8g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)