UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jm25w9GS170Gd06gzS8x1GecCcvswEWdhd+rWv8be40='
WHERE
key_id = 'de5dbb3791f9c886f96491bbbbc105a33d64aa2bcdcdda5561a9919a759a0c72'
AND (
token = 'jm25w9GS170Gd06gzS8x1GecCcvswEWdhd+rWv8be40='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)