UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Aa8nhIgc7B0IoJ4MvbRP5d+fMYXqozLQ8xR7y09qDA0='
WHERE
key_id = 'bd228234baa929b8ad6fc1f3780d52a292b996f8693cdae6397184edd8ab73eb'
AND (
token = 'Aa8nhIgc7B0IoJ4MvbRP5d+fMYXqozLQ8xR7y09qDA0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)