UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pIvpK8+ixVFpGK+lDmqKexEm35UmuCoFy4VL4vIJ9+4='
WHERE
key_id = '574ede9e569158289565d6cc947cbe9311e49dfc0beaae1d3d224f7e4589f70c'
AND (
token = 'pIvpK8+ixVFpGK+lDmqKexEm35UmuCoFy4VL4vIJ9+4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)