UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lemEvVsfwJwchkCmU3K64gOERNKECRYtckuZ7X2enIg='
WHERE
key_id = '6bac582b0bb746f4de81631109be74ba53e6cb1be7256536af482ede44d7971a'
AND (
token = 'lemEvVsfwJwchkCmU3K64gOERNKECRYtckuZ7X2enIg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)