UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nveTrTD+SkDOsggsj3Q54IvGUNtn/t6q9dTRVrrvVK0='
WHERE
key_id = '2dbc2e3bcfd985183c58224e54845a7936a0e163c5dd315920a0a844e07da0d6'
AND (
token = 'nveTrTD+SkDOsggsj3Q54IvGUNtn/t6q9dTRVrrvVK0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)