UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mAzGdqbl8Yd9zsVaryhKmunOx80F7zrUf2t67ydzD7M='
WHERE
key_id = '26c7efca960ea163b2ec1fb552ed819967ad80b84950862c4774b15652ce70f9'
AND (
token = 'mAzGdqbl8Yd9zsVaryhKmunOx80F7zrUf2t67ydzD7M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)