UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0sLpG1Q/+r6KbpRDZPHeZWAn0UpIahw6CFbjZx5RVks='
WHERE
key_id = '19b4f40f5bc8fb1df9c947faf1b35b64d1c14075cd2f24f79873bd0d2272eb27'
AND (
token = '0sLpG1Q/+r6KbpRDZPHeZWAn0UpIahw6CFbjZx5RVks='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)