UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pFUkOgIzuWKkl7FdCUS64/6VaHkMImpIbmMKVXPArKo='
WHERE
key_id = '9551ace0042431050058a7174cccd1435a078577037858eb22bbf065fbdb70f3'
AND (
token = 'pFUkOgIzuWKkl7FdCUS64/6VaHkMImpIbmMKVXPArKo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)