UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '41/pKOTLIWC8u5pJUAg+wNyxBUyduN0CZAzHUxa5NIk='
WHERE
key_id = 'e450fc149fadfaef9b936892d17bf537d45d19134a911ff4df37adf1c554f01c'
AND (
token = '41/pKOTLIWC8u5pJUAg+wNyxBUyduN0CZAzHUxa5NIk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)