UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vMsDa1nWvHQfLu/UTp9arJI94rIsnKFndgbsmdKikAs='
WHERE
key_id = '9061c7a6caf6e7120b9b40c9bb62450ea6fb6492424e435a6f7d42c68c2e4ed8'
AND (
token = 'vMsDa1nWvHQfLu/UTp9arJI94rIsnKFndgbsmdKikAs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)