UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6VLqqoRKTGeaWei5/hOW3A2DjuWUWhoEJmLUMLdp8yU='
WHERE
key_id = '5a07bd27db670539e47d9038f00d17a89d7bc4963bebf07541f0c83b2456f8dd'
AND (
token = '6VLqqoRKTGeaWei5/hOW3A2DjuWUWhoEJmLUMLdp8yU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)