UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZSQ0nEySLKyHzXe/YmWP63BBdx9PoMB0Min+1zaiXY0='
WHERE
key_id = '1fa5ecc0e6e705f832ee97baaebc31c4f35429b1998cc7258212b74a2afa4272'
AND (
token = 'ZSQ0nEySLKyHzXe/YmWP63BBdx9PoMB0Min+1zaiXY0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)