UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '91qTbwLYY/BeYguBQb56As/JwgaOM8TJInZ8HgdQ21M='
WHERE
key_id = '095b12670df597153b56584a7a91dc51b83d4dd9fc5843d2b24ea75f718afeda'
AND (
token = '91qTbwLYY/BeYguBQb56As/JwgaOM8TJInZ8HgdQ21M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)