UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ENtLKFpMuNH2CA/g+ZEFqpUhcy5gECA9Sq95eThwkNA='
WHERE
key_id = 'e95a099262e3ad93e6df3a4f2c90f25cbeabddb74db7f65214804c31206d9d6e'
AND (
token = 'ENtLKFpMuNH2CA/g+ZEFqpUhcy5gECA9Sq95eThwkNA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)