UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5Qkg9HsB56eHt5ifBsZbUI9rSc1CAUjPP/CD2VyFsfY='
WHERE
key_id = 'c25c76c7e947c5dd4e77905bb701f3696292952a64467b1f62dbc08a73412685'
AND (
token = '5Qkg9HsB56eHt5ifBsZbUI9rSc1CAUjPP/CD2VyFsfY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)