UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2xU4YHEYGe+gciSWqK8y+TXUw7tta7+irTa8Hy/HB8U='
WHERE
key_id = 'fa27959919bb5f882aa992f891b4a24b0094301e8ae15d8f36bf8e18a9fb8e7f'
AND (
token = '2xU4YHEYGe+gciSWqK8y+TXUw7tta7+irTa8Hy/HB8U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)