UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'A4h4eeSrYZ3P1ooQyEIJyZbdc8BLW0f4snO/q5+xG+M='
WHERE
key_id = '43a8e3e58a941a980b1e917030c9b270183e1dc3b0709299b6247b77f92ba271'
AND (
token = 'A4h4eeSrYZ3P1ooQyEIJyZbdc8BLW0f4snO/q5+xG+M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)