UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pYC22P+VABh0tX/4zN8MjtenMSsQMlFp1mCKoSq2LFw='
WHERE
key_id = 'd0076f72351804104152fa96dc6d310429bc24364b950c2ed6fffeaeafa790f7'
AND (
token = 'pYC22P+VABh0tX/4zN8MjtenMSsQMlFp1mCKoSq2LFw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)