UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ccBr6WjnbLyFb/K39qCbRebAEc9OKyH7IGBc/j7LTug='
WHERE
key_id = 'aa8009f1e489cb560fdae9bb79fbcc226a54d2253e7b3406bdbc0f0a66b7998a'
AND (
token = 'ccBr6WjnbLyFb/K39qCbRebAEc9OKyH7IGBc/j7LTug='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)