UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kqY+kY+CJkH91QfU99iyBUrw2rmQM5tLaBThjNZLGug='
WHERE
key_id = '4ca61b9e80e8e69cbe54a89c35d4411f84898bebdfbef39e0950ce6d0147d517'
AND (
token = 'kqY+kY+CJkH91QfU99iyBUrw2rmQM5tLaBThjNZLGug='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)