UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '99EU2G8W2OwGBPDcH13snxf7NdVSlNfLzyGOM2VGOxY='
WHERE
key_id = 'c4e746acc157b67eecd9c09c7fe24f68213e929fcc2e47d4ad676f4bee24f324'
AND (
token = '99EU2G8W2OwGBPDcH13snxf7NdVSlNfLzyGOM2VGOxY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)