UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CQzAlK60o+cQzQ4tp1ElZMhpgtm7XO8hMRRzSHmUzDc='
WHERE
key_id = '3911890b84973c0be01668a6a6484268e48ba6888be655a5e547ebd78cb6f82f'
AND (
token = 'CQzAlK60o+cQzQ4tp1ElZMhpgtm7XO8hMRRzSHmUzDc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)