UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LEww+tNnDbfVdGSwLItYWRX7WMwBVy1k8SQGVeEu63c='
WHERE
key_id = '447c1b64ba3af167b11900efcf0b1c5f6395f8127982a55a25f2bb6c31384a6f'
AND (
token = 'LEww+tNnDbfVdGSwLItYWRX7WMwBVy1k8SQGVeEu63c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)