UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wGF3WEAkqvS6f3Tb0uHwy7YSZmfXjFdhUcNlxuRtZ8o='
WHERE
key_id = 'b03e1990a91a2d188a1bab528a6c7d80e8a6ceee1c1ce23d1207b77ba80fb645'
AND (
token = 'wGF3WEAkqvS6f3Tb0uHwy7YSZmfXjFdhUcNlxuRtZ8o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)