UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bxLyWfAdJXhFPn0jIsifqzRO01pr161b/y91Eph/kAg='
WHERE
key_id = 'd453dee6610d4b2b476f3e7c0950b1f94c8e97c23ea4bc0f6e5402121d8a413d'
AND (
token = 'bxLyWfAdJXhFPn0jIsifqzRO01pr161b/y91Eph/kAg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)