UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F3AcvxjqTreqOnSwpBLbQNdWGm2baHl/KZnqMmvjGRo='
WHERE
key_id = '577593f58350795df844865af5bd3ffa25c6b86fdcb67f7992ee6dee40fe6b1e'
AND (
token = 'F3AcvxjqTreqOnSwpBLbQNdWGm2baHl/KZnqMmvjGRo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)