UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6t47E9Arhcvxta2cvG/VQ7cHVq0wN/d32xgNw3gEqJY='
WHERE
key_id = 'c7347abab0c25f5076b31ffc360e0df3475246f8ae07ce85ff7174fd6fcf6948'
AND (
token = '6t47E9Arhcvxta2cvG/VQ7cHVq0wN/d32xgNw3gEqJY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)